: Operators in PHP --- arithmetic operators, logical operators, value assignment operators, and comparison operators: 1. arithmetic operators common arithmetic operators calculation type operators example result calculation inverse operations -- $ a
Operators in PHP --- Arithmetic Operators, logical operators, value assignment operators, comparison operators, and operator assignment
1. Arithmetic Operators
Common Arithmetic Operators
Operation Type
Operator
Example
Result
1. Arithmetic operators
Common arithmetic operators
Type of operation
Operator
Example
Results
Take inverse operation
-
-$a
Returns a negative value of $ A
Addition operation
+
$a +
Assignment operatorsAn assignment symbol "=" is an assignment operator whose purpose is to assign a data to a variable. The function of "a=3" is to perform an assignment (or an assignment operation) once. Assign the constant 3 to the variable A. You
The compound assignment operators are: + =,-=, *=,/=,%=, >=, >>>=, &=, ^=, and | =The simple assignment operator is =;The code is as follows:public class Example009 {public static void main (string[] args) {short x = 1;int X1 = 1;int i = 123456;x + =
C # overview of various operators and functions of operators,I. []
Square brackets ([]) are used for arrays, indexers, and attributes, and can also be used for pointers.
1. the array type is a type followed:
Int [] fib = new int [100]; // create an
Addition operator: + and-Grammar
expression + expression
expression–expression
NoteThe Add operator is:
Add (+)
Minus (–)
These binary operators have left to right associations.
The add operator takes an operand of
One, bitwise operatorsIn general applications, we basically use an operator that is not in place. Although, it is based on the underlying, performance and speed will be very good, and that is because the lower level, the use of the difficulty is
In C + +, there are three major function copy controls (copy constructors, assignment operators, destructors), while in c++11, move constructors are added to move assignment operators. I would have ventured to name them six functions well.
first,
The compound assignment operators include + =,-=, * =,/=, % =, >=, & =, ^ =, | =.
The following uses + = as an example.
A + = expression (1)
It is equivalent:
A = a + expression (2)
However, there is a difference here. (1) expression A (such as the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.